configurable = False
from common import *
from mig.csp2mig.server import *
import sys
def MiG_WrapperFunc(in0,out0):
	result = None
	error = None
	try:
		s = Migsession()	
		# get input. locates the input-file based on an environment variable
		input_val = s.read_input()
		#send the value to the original subnetwork.
		out0(input_val)
		#get the result
		result = in0()
	except:
		error = str(sys.exc_info())
	finally:
		# commit the job output
		s.write_output((result,error))
		# poison channels to terminate the job on MiG	
		poison(in0)
		poison(out0)
